#version 300 es 

precision mediump float;

uniform sampler2D u_mainTex;    //纹理
uniform vec4 u_mainColor;       //颜色

in vec2 v_uv;

out vec4 color;

void main() {
    vec4 texColor = texture(u_mainTex, v_uv);    //纹理颜色
    vec4 mulColor = u_mainColor;
    #ifdef RED
    mulColor = mix(vec4(1.f, 0.f, 0.f, 1.f), mulColor, 0.5f);
    #endif

    #ifdef GREEN
    mulColor = mix(vec4(0.f, 1.f, 0.f, 1.f), mulColor, 0.5f);
    #endif

    #ifdef BLUE
    mulColor = mix(vec4(0.f, 0.f, 1.f, 1.f), mulColor, 0.5f);
    #endif

    color = texColor * mulColor;
}